1. Field of the Invention
This invention relates to a method and apparatus for debouncing electrical signals. In particular, this invention relates to a filter for simultaneously processing multiple noisy signals to produce multiple corresponding debounced signals.
2. Description of the Related Art
Within copiers or other systems, there are a large number of binary input signals used to control the system. These signals come from sensors or switches in the system. Most switches and some sensors suffer from a phenomenon called bounce when changing state.
FIG. 1 shows a simple switch circuit 10 containing switch 12, voltage source 14 and resistor 16. Output voltage V will depend on the switch state of switch 12. When the switch is changed from an open to a closed state, current flows through the resistor and the voltage V at the output increases from zero volts to the voltage of the voltage source 14. When the switch is changed from a closed state to an open state, the voltage V at the output returns to zero volts.
FIG. 2 shows a graph of the voltage V as a function of time T. When switch 12 is changed from an open state to a closed state at time T.sub.0 the output voltage V attains the voltage of the voltage source 14 after undergoing a noisy transition as shown in FIG. 2. When processed through digital circuits, the noisy signal of output voltage V becomes a binary signal (having an on state and an off state). The binary signals often have a significant bounce time as shown in FIG. 14. Without proper filtering, the bouncing signal shown in FIG. 14, may be interpreted by a machine as multiple actuations of switch 12.
Many modern systems are controlled by microprocessors. When a bouncing signal is input to a microprocessor controlled system, the bouncing signal can cause a number of problems for the software running on the microprocessor if the bouncing signal is not properly filtered. A debounce filter, whether implemented in hardware or software, waits until the input signal has stabilized for a specific period of time before changing the output signal from the filter. The software controlled microprocessor then uses the filtered signal as the control signal for the microprocessor controlled system. Such a debounce filter has a debounce filter time delay as shown in FIG. 5.
A complication in designing large systems arises from two properties. The first is that different switches and sensor types are often characterized by different bounce times, thus requiring different filters and different filter characteristics. The second is that a large system often imposes different timing requirements, such as the maximum tolerable delay, on the signals coming from the several switches and sensors in the system. Therefore, it is often necessary to process signals from different switches through different filter types to produce the corresponding filtered signals.
One method of filtering input signals is a two sample approach where two samples are sequentially taken and compared. If the two samples agree, then the value of the two samples is output as the filter output.
In another method of filtering input signals, the input voltage V is sampled at a regular rate. If the input sampled signal changes state, then a counter is incremented at the sample rate as long as the input signal differs from the present filter output. When the counter reaches a particular maximum value, then the filter output changes. If the input signal changes back to the present filter output value while the counter is still being incremented, then the counter is reset. In this method it is necessary to have a counter for every signal input to be debounced. In a microprocessor based filter system, this results in a large use of RAM and significant execution time for every input.
FIG. 6 is a timing diagram for the method using a counter where the counter is set to 6. This method is superior to the two sample approach in that more samples are taken, reducing the chance of incorrect reporting. However, this method uses even more time than the two sample approach.